﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    <link rel="stylesheet" href="../../Scripts/zTree/css/demo.css" type="text/css" />
    <link rel="stylesheet" href="../../Scripts/zTree/css/zTreeStyle/zTreeStyle.css" type="text/css" />

    <script type="text/javascript" src="../../Scripts/zTree/js/jquery-1.4.4.min.js"></script>

    <script type="text/javascript" src="../../Scripts/zTree/js/jquery.ztree.core-3.0.js"></script>

    <script type="text/javascript" src="../../Scripts/zTree/js/jquery.ztree.excheck-3.0.js"></script>

    <script type="text/javascript">
		var setting = {
	        check: {
		        enable: true,
		        chkStyle: "checkbox",
		        chkboxType: { "Y": "s", "N": "s" }
	        }
		};
		//  [{ name: "父节点1", children: [{ name: "子节点1" }, { name: "子节点2"}]}];
        var zNodes = <%=ViewData["formdefi"] %>;       
         
		$(document).ready(function(){
			$.fn.zTree.init($("#treeDemo"), setting, zNodes);
		});
		
		
		function count() {
            var zTree = $.fn.zTree.getZTreeObj("treeDemo");
            nodes = zTree.getCheckedNodes(true);

            var classpurview = "";
            for(var i=0;i<nodes.length;i++) {
            classpurview += "," + nodes[i].id
            }
            alert(classpurview);
        }
    </script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div>
        <div class="zTreeDemoBackground left">
            <ul id="treeDemo" class="ztree">
            </ul>
        </div>
        <%--      <input type="hidden" id="nextclr"  />--%>
        <input type="button" onclick="count()" />
    </div>
</asp:Content>
